package br.edu.ufcg.dsc.actions.user;

import org.apache.struts2.config.ParentPackage;
import org.apache.struts2.config.Result;
import org.apache.struts2.dispatcher.ServletRedirectResult;

import br.edu.ufcg.dsc.actions.BaseLoggedAction;

import com.opensymphony.xwork2.ActionContext;

@ParentPackage(value = "myPackage")
@Result(name = "success", type = ServletRedirectResult.class, value = "/index.action?message=You are Logged Out.")
public class LogoutAction extends BaseLoggedAction {

	private static final long serialVersionUID = 8981289164405102076L;

	@Override
	protected String executeIfLogged() throws Exception {
		ActionContext.getContext().getSession().remove("user");
		return SUCCESS;
	}

}
